package com.tcs.test.designmodel.singleion;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 线程安全的
* @Title: Singleion1.java
* @Package com.tcs.test.designmodel.singleion
* @author 神经刀
* @date 2018年11月19日
* @version V1.0
 */
public class Singleion2 {
	
	private final Logger logger = LoggerFactory.getLogger(Singleion2.class);
	
	public static class Singleion2Hold {
		private static final Singleion2 SINGLEION = new Singleion2();
	}
	
	private Singleion2() {
		logger.info("init class ");
	};
	
	public static synchronized Singleion2 getSingleion1() {
		return Singleion2Hold.SINGLEION;
	}
}